#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void polish(FILE* pf, char s[], char dictionary[][15], int line) {
	rewind(pf);
	int res, i, j;
	char str[8] = { '!','@','#','$','%','^','&','*' };
	for (i = 0; i < line; i++) {
		j = 0;
		res = fgetc(pf);
		while (res != 10) {
			dictionary[i][j] = (char)res;
			j++;
			res = fgetc(pf);
		}
		dictionary[i][j] = '\0';
	}
	i = 0;
	int k = 0, flag = 0, temp = 0, t = 0;
	while (s[i] != '\0') {
		flag = 0;

		for (j = 0; j < line; j++) {
			temp = i;
			k = 0;
			while (s[temp] == dictionary[j][k]) {
				temp++;
				k++;
				if (dictionary[j][k] == '\0') {
					for (int l = 0; l < 8; l++) {
						printf("%c", str[l]);
					}
					flag = 1;
					break;
				}
			}
			if (flag == 1) {
				break;
			}
		}
		if (flag == 1) {
			i = temp;
		}
		else {
			printf("%c", s[i]);
			i++;
		}
	}
}
int main() {
	FILE* pf = fopen("dict.dic", "r");
	char s[110];
	int line = 0, res = fgetc(pf);
	char dictionary[15][15];
	while (!feof(pf)) {
		if (res == 10) {
			line++;
		}
		res = fgetc(pf);
	}

	while (gets(s)) {
		polish(pf, s, dictionary, line);
		printf("\n");
	}
	fclose(pf);
	pf = NULL;
	return 0;
}